public class Array {
    public static double avg(int[] array) {
        int sum = sum(array);
        double result = ((double)sum)/array.length;
        return result;
    }
    public static int sum(int[] array) {
        int sum2 = 0;
        for (int i:array){
            sum2 += i;
        }
        return sum2;
    }
    public static void printArray(int[] array){
        for (int i:array) {
            System.out.println(i+" ");
        }

    }
    public static void main(String[] args) {
        int[] array1={1,2,3,4,5,6,7,8,9,10};
        double avg1=avg(array1);
        int sum1=sum(array1);
        printArray(array1);
        System.out.println("平均值:"+avg1);
        System.out.println("求和:"+sum1);
    }
}
